<html>
<head><meta charset="utf-8"><title>term and terminfo · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20and.20terminfo.html">term and terminfo</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="242871844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20and%20terminfo/near/242871844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BurntSushi <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20and.20terminfo.html#242871844">(Jun 16 2021 at 12:20)</a>:</h4>
<blockquote>
<p>almost none of them respect terminfo, which IMO should be a hard requirement for a replacement</p>
</blockquote>
<p><span class="user-mention" data-user-id="209168">@Thom Chiovoloni</span> for termcolor at least, this was very much intentional. termcolor was born inside of ripgrep, and one of the things it specifically did was to stop trying to read the terminfo database. it was causing lots of quite difficult bugs to diagnose. see <a href="https://github.com/BurntSushi/ripgrep/commit/e8a30cb8934106e63f9d0938c547e535acb7b888">https://github.com/BurntSushi/ripgrep/commit/e8a30cb8934106e63f9d0938c547e535acb7b888</a> for the change. see <a href="https://github.com/BUrntSushi/ripgrep/issues/37">https://github.com/BUrntSushi/ripgrep/issues/37</a> for an example bug. see <a href="https://github.com/BurntSushi/ripgrep/issues/182">https://github.com/BurntSushi/ripgrep/issues/182</a> for another bug and some meta discussion about the utility of terminfo.</p>
<p>this also matches how very widely used tools (like GNU grep) work. they don't consult terminfo either.</p>



<a name="242887232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20and%20terminfo/near/242887232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20and.20terminfo.html#242887232">(Jun 16 2021 at 14:18)</a>:</h4>
<p>Honestly, I think that's reasonable for modern tools. Just assume ANSI-compatible color, which is what everything supports.</p>



<a name="242887360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20and%20terminfo/near/242887360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20and.20terminfo.html#242887360">(Jun 16 2021 at 14:19)</a>:</h4>
<p>terminfo is important for other things, like control sequences to scroll or position, but not for color anymore.</p>



<a name="242904881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20and%20terminfo/near/242904881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20and.20terminfo.html#242904881">(Jun 16 2021 at 16:21)</a>:</h4>
<p>doesn't terminfo still inform capabilities like 24-bit RGB colors?</p>



<a name="242905293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20and%20terminfo/near/242905293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20and.20terminfo.html#242905293">(Jun 16 2021 at 16:24)</a>:</h4>
<p>Apparently that finally got added to terminfo. For a <em>long</em> time, the only way to detect 24-bit RGB support was via environment variables.</p>



<a name="242905402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20and%20terminfo/near/242905402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20and.20terminfo.html#242905402">(Jun 16 2021 at 16:24)</a>:</h4>
<p>I really wish terminal capabilities were provided via some means other than a file-based database, since that doesn't work well for remote shells or serial-ish connections.</p>



<a name="242907204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20and%20terminfo/near/242907204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20and.20terminfo.html#242907204">(Jun 16 2021 at 16:38)</a>:</h4>
<div class="codehilite"><pre><span></span><code>$ find /usr/share/terminfo -type f | wc -l
2782
</code></pre></div>
<p><span aria-label="cry" class="emoji emoji-1f622" role="img" title="cry">:cry:</span></p>



<a name="242926854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20and%20terminfo/near/242926854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20and.20terminfo.html#242926854">(Jun 16 2021 at 19:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/219381-t-libs/topic/term.20and.20terminfo/near/242905402">said</a>:</p>
<blockquote>
<p>I really wish terminal capabilities were provided via some means other than a file-based database, since that doesn't work well for remote shells or serial-ish connections.</p>
</blockquote>
<p>there's been ongoing work in <a href="https://gitlab.freedesktop.org/terminal-wg/specifications">https://gitlab.freedesktop.org/terminal-wg/specifications</a> along these lines (it involves writing escape sequences that that query device capabilities, and reading the response back), although it doesn't fully replace terminfo.</p>



<a name="242935076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20and%20terminfo/near/242935076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20and.20terminfo.html#242935076">(Jun 16 2021 at 20:02)</a>:</h4>
<p>Right; at a minimum you need to know if you can ever expect a response. Timeouts aren't fun.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>